package aop.springAop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import aop.springAop.dao.CityOneDao;
import aop.springAop.dao.CityTwoDao;
import aop.springAop.dao.impl.CityOneDaoImpl;

public class AopTest {
	public static void main(String[] args) {
		CityOneDaoImpl cityOneDaoImpl = new CityOneDaoImpl();
		CityOneDaoAspect aspect = new CityOneDaoAspect();
//		CityOneDao cityOneDao = (CityOneDao) aspect.around(Joinpoint.class);
		// 创建容器对象
		//普通文件使用/
		ApplicationContext ac = new ClassPathXmlApplicationContext("aop/springAop/bean.xml");
		// 从容器中获取Action
		CityOneDao userAction = (CityOneDao) ac.getBean("cityOneDaoImpl");
		CityTwoDao userTwoAction = (CityTwoDao) ac.getBean("cityTwoDaoImpl");
		userAction.add();
		userAction.delete();
		userAction.list();
		userTwoAction.add();
		userTwoAction.delete();
		userTwoAction.list();

	}
}
